package com.per.mybootall.excel.utils;

//import com.alibaba.excel.EasyExcel;
//import com.alibaba.excel.ExcelWriter;
//import com.alibaba.excel.write.metadata.WriteSheet;
import com.per.mybootall.excel.po.StudentsPo;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public class ExcelUtils {
    /**
     * 导出Excel
     * response：响应的对象
     * list：需要导出的数据list
     * */
    public static void writeExcel(HttpServletResponse response, List<StudentsPo> list) throws IOException {
//        ExcelWriter excelWrite=  EasyExcel.write(response.getOutputStream()).build();
//        //sheet是定义的工作表的对象
//        WriteSheet sheet= EasyExcel.writerSheet(0,"sheet").head(StudentsPo.class).build();
//        //向excel中写入数据
//        excelWrite.write(list,sheet);
//        //关闭输出流
//        excelWrite.finish();
    }
}
